package com.masterclient.app.modules.search;

import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.eoner.baselibrary.utils.GlideUtil;
import com.masterclient.app.R;
import com.masterclient.app.modules.search.beans.SearchResultDataBean;

public class SearchResultAdapter extends BaseQuickAdapter<SearchResultDataBean.ProductItem, BaseViewHolder> {

    public SearchResultAdapter() {
        super(R.layout.search_result_item);
    }

    @Override
    protected void convert(BaseViewHolder helper, SearchResultDataBean.ProductItem item) {
        ImageView iv = helper.getView(R.id.iv_img);
        TextView tvTitle = helper.getView(R.id.tv_title);
        TextView tvTime = helper.getView(R.id.tv_time);

        tvTitle.setText(item.name);
        tvTime.setText(item.author);
        GlideUtil.displayRoundImage(mContext, item.image, iv, 4, R.mipmap.defaults);
    }
}
